// 导入 mongoose 模块
const mongoose = require("mongoose");

// 创建文档结构
let accountSchema = new mongoose.Schema({
  title: {
    type: String,
    required: true,
  },
  time: Date,
  type: {
    type: Number,
    default: -1,
  },
  account: {
    type: Number,
    required: true,
  },
  remarks: String,
});

// 创建文档结构对象
let accountModel = mongoose.model("accounts", accountSchema);

// 暴露接口
module.exports = accountModel;
